package erpAndEmailTest;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

public class ErpLoginAndFillWorkDay {
	public static void main(String[] args) {
		System.setProperty("webdriver.chrome.driver","c:\\test\\chromedriver.exe");
		WebDriver driver = new ChromeDriver();
		driver.get("https://mail-huazhong01.beyondsoft.com/mail/baizonggui.nsf");
		waitForMilliseconds(3000);
		WebElement userName = driver.findElement(
				By.xpath("html/body/form/table/tbody/tr/td[2]/div/table/tbody/tr[2]/td/table/tbody/tr[5]/td[2]/input"));
		userName.sendKeys("baizonggui");
		WebElement password = driver.findElement(
				By.xpath("html/body/form/table/tbody/tr/td[2]/div/table/tbody/tr[2]/td/table/tbody/tr[7]/td[2]/input"));
		password.sendKeys("andrew123");
		WebElement submit = driver.findElement(
				By.xpath("html/body/form/table/tbody/tr/td[2]/div/table/tbody/tr[2]/td/table/tbody/tr[9]/td[2]/input"));
		submit.click();
	}
	private static void waitForMilliseconds(long time){
		try {
			Thread.sleep(time);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}
